function deletePetrinet(url)
{
	var request_headers = ['Accept', 'application/xhtml+xml'];
	
	new Ajax.Request(url, {
		method: 'delete',
		requestHeaders: request_headers,
		onSuccess: function(transport) {
			document.location.reload();		
		}
	});
};

function createPetrinet(){
	$('new_petrinet_loading').show();
	$('new_petrinet_error').hide();
	$('new_petrinet_form').request({
		onSuccess: function() {
			document.location.reload();	
		},
		onFailure: function(response) {
			$('new_petrinet_loading').hide();
			$('new_petrinet_error').show();
			$('errors').update(response.responseText);
		}
	});
};

function submitMonitorMeasure(case_id){
	$('measure_form_'+case_id).request({
		onSuccess: function(res) {
			$('measure_result_'+case_id).update(res.responseText);
		},
		onFailure: function(response) {
			$('new_petrinet_loading').hide();
			$('new_petrinet_error').show();
			$('errors').update(response.responseText);
		}
	});
};
